package org.sixtynine.stock.util;

/**
 * this will keep the signals for the home page
 * 
 * @author Thilanka
 * 
 */
public class Signal {

	public enum SignalType {
		HIGH, LOW, RSI_OVERBOUGHT, RSI_OVERSOLD, UNUSUAL_VOLUME, MOST_VOLATALITY, SMA50_CROSSING, SMA20_CROSSING, SMA10_CROSSING;
	}

	public Signal() {
	}

	public Signal(String message, SignalType type, String companyCode,
			double sharePrice, double value, double change, String color) {
		this.message = message;
		this.type = type;
		this.companyCode = companyCode;
		this.value = value;
		this.sharePrice = sharePrice;
		this.change = change;
		this.color = color;
	}

	public Signal(String message, SignalType type, String companyCode,
			double sharePrice, double value, double change, double turnOver,
			double noOfTrade, String companyName) {
		this.message = message;
		this.type = type;
		this.companyCode = companyCode;
		this.value = value;
		this.sharePrice = sharePrice;
		this.change = change;
		this.turnOver = turnOver;
		this.companyName = companyName;
	}

	public Signal(String message, SignalType type, String companyCode,
			double sharePrice, double value, double change, double turnOver,
			double noOfTrade, String companyName, String color) {
		this.message = message;
		this.type = type;
		this.companyCode = companyCode;
		this.value = value;
		this.sharePrice = sharePrice;
		this.change = change;
		this.turnOver = turnOver;
		this.companyName = companyName;
		this.color = color;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public Signal(String message, SignalType type, String companyCode,
			double sharePrice, double value, double change) {
		this.message = message;
		this.type = type;
		this.companyCode = companyCode;
		this.value = value;
		this.sharePrice = sharePrice;
		this.change = change;
	}

	private String message;
	private SignalType type;
	private String companyCode;
	private double value;
	private double change;
	private double sharePrice;
	private double turnOver;
	private double noOfTrade;
	private String companyName;
	private String color;

	public double getTurnOver() {
		return turnOver;
	}

	public void setTurnOver(double turnOver) {
		this.turnOver = turnOver;
	}

	public double getNoOfTrade() {
		return noOfTrade;
	}

	public void setNoOfTrade(double noOfTrade) {
		this.noOfTrade = noOfTrade;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public SignalType getType() {
		return type;
	}

	public void setType(SignalType type) {
		this.type = type;
	}

	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	public double getValue() {
		return value;
	}

	public void setValue(double value) {
		this.value = value;
	}

	public double getChange() {
		return change;
	}

	public void setChange(double change) {
		this.change = change;
	}

	public double getSharePrice() {
		return sharePrice;
	}

	public void setSharePrice(double sharePrice) {
		this.sharePrice = sharePrice;
	}

	@Override
	public int hashCode() {
		return (companyCode + type).hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		Signal sig = (Signal) obj;
		return ((sig.getCompanyCode().equals(companyCode)) && (sig.getType()
				.equals(type)));
	}

}
